--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 6194933ce62b1b9299a23d91b985ecc4e42b8e4b
Parents : ebcd3c6
Author : Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-04-16T23:33:14-05:00
feat(config): add configuration options for warning on stranger links and messages sidebar position
Changes
5 files changed, 32 insertions(+), 4 deletions(-)
Diff
diff --git a/meshchatx/meshchat.py b/meshchatx/meshchat.py
index cfbbdd60..af973e3c 100644
--- a/meshchatx/meshchat.py
+++ b/meshchatx/meshchat.py
@@ -11316,6 +11316,11 @@ class ReticulumMeshChat:
self._parse_bool(data["show_unknown_contact_banner"]),
)
+ if "warn_on_stranger_links" in data:
+ self.config.warn_on_stranger_links.set(
+ self._parse_bool(data["warn_on_stranger_links"]),
+ )
+
# update banishment settings
if "banished_effect_enabled" in data:
self.config.banished_effect_enabled.set(
@@ -11336,6 +11341,13 @@ class ReticulumMeshChat:
if value is not None:
self.config.message_font_size.set(value)
+ if "messages_sidebar_position" in data:
+ raw = data["messages_sidebar_position"]
+ if raw is not None:
+ s = str(raw).strip().lower()
+ if s in ("left", "right"):
+ self.config.messages_sidebar_position.set(s)
+
if "message_icon_size" in data:
try:
value = int(data["message_icon_size"])
@@ -12542,10 +12554,12 @@ class ReticulumMeshChat:
"block_attachments_from_strangers": ctx.config.block_attachments_from_strangers.get(),
"block_all_from_strangers": ctx.config.block_all_from_strangers.get(),
"show_unknown_contact_banner": ctx.config.show_unknown_contact_banner.get(),
+ "warn_on_stranger_links": ctx.config.warn_on_stranger_links.get(),
"banished_effect_enabled": ctx.config.banished_effect_enabled.get(),
"banished_text": ctx.config.banished_text.get(),
"banished_color": ctx.config.banished_color.get(),
"message_font_size": ctx.config.message_font_size.get(),
+ "messages_sidebar_position": ctx.config.messages_sidebar_position.get(),
"message_icon_size": ctx.config.message_icon_size.get(),
"ui_transparency": ctx.config.ui_transparency.get(),
"ui_glass_enabled": ctx.config.ui_glass_enabled.get(),
diff --git a/meshchatx/src/backend/bot_handler.py b/meshchatx/src/backend/bot_handler.py
index e9b0355d..58cad14d 100644
--- a/meshchatx/src/backend/bot_handler.py
+++ b/meshchatx/src/backend/bot_handler.py
@@ -157,7 +157,9 @@ class BotHandler:
):
with contextlib.suppress(Exception):
lh = instance.bot.local.hash
- address_full = lh.hex() if isinstance(lh, (bytes, bytearray)) else None
+ address_full = (
+ lh.hex() if isinstance(lh, (bytes, bytearray)) else None
+ )
if address_full:
address_full = self._normalize_lxmf_hash_hex(address_full)
if address_full:
@@ -171,7 +173,9 @@ class BotHandler:
destination = RNS.Destination(identity, "lxmf", "delivery")
address_full = self._normalize_lxmf_hash_hex(destination.hash)
if address_full:
- address_pretty = RNS.prettyhexrep(bytes.fromhex(address_full))
+ address_pretty = RNS.prettyhexrep(
+ bytes.fromhex(address_full)
+ )
if address_full is None:
address_full = self._read_lxmf_address_sidecar(entry.get("storage_dir"))
diff --git a/meshchatx/src/backend/config_manager.py b/meshchatx/src/backend/config_manager.py
index 27518812..edd1c7a7 100644
--- a/meshchatx/src/backend/config_manager.py
+++ b/meshchatx/src/backend/config_manager.py
@@ -296,6 +296,11 @@ class ConfigManager:
"show_unknown_contact_banner",
True,
)
+ self.warn_on_stranger_links = self.BoolConfig(
+ self,
+ "warn_on_stranger_links",
+ True,
+ )
# banishment config
self.banished_effect_enabled = self.BoolConfig(
@@ -314,6 +319,11 @@ class ConfigManager:
"#dc2626",
)
self.message_font_size = self.IntConfig(self, "message_font_size", 14)
+ self.messages_sidebar_position = self.StringConfig(
+ self,
+ "messages_sidebar_position",
+ "left",
+ )
self.message_icon_size = self.IntConfig(self, "message_icon_size", 28)
self.ui_transparency = self.IntConfig(self, "ui_transparency", 0)
self.ui_glass_enabled = self.BoolConfig(self, "ui_glass_enabled", True)
diff --git a/meshchatx/src/version.py b/meshchatx/src/version.py
index 0c6a13c3..d1cb3ff8 100644
--- a/meshchatx/src/version.py
+++ b/meshchatx/src/version.py
@@ -1,5 +1,3 @@
-# SPDX-License-Identifier: 0BSD
-
"""Version string synced from package.json.
Do not edit by hand. Run: pnpm run version:sync.
diff --git a/tests/backend/test_telephone_audio_ws.py b/tests/backend/test_telephone_audio_ws.py
index 8538c9ae..7da61665 100644
--- a/tests/backend/test_telephone_audio_ws.py
+++ b/tests/backend/test_telephone_audio_ws.py
@@ -7,6 +7,8 @@ import pytest
from aiohttp import web
from aiohttp.test_utils import TestClient, TestServer
+pytestmark = pytest.mark.usefixtures("require_loopback_tcp")
+
def _build_aio_app(app):
routes = web.RouteTableDef()
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────